/**********************************
 * @Author: Your Name
 * @LastEditor: Your Name
 * @LastEditTime: 2025-11-07
 * Copyright © 2025 Your Name
 **********************************/

// 审计日志管理相关Mock数据
export const auditLogMockData = {
  // 审计日志列表
  logs: [
    {
      id: 1,
      username: 'admin',
      operation: '登录系统',
      method: 'POST',
      url: '/auth/login',
      ip: '192.168.1.100',
      userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
      requestParams: '{"username":"admin","password":"***"}',
      responseResult: '{"code":0,"message":"success","data":{"token":"xxx"}}',
      executionTime: 120,
      operationTime: '2025-03-15T10:30:00.000+08:00',
      module: '认证模块',
      status: 'SUCCESS',
    },
    {
      id: 2,
      username: 'user1',
      operation: '创建项目',
      method: 'POST',
      url: '/projects',
      ip: '192.168.1.101',
      userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
      requestParams: '{"name":"新项目","description":"项目描述"}',
      responseResult: '{"code":0,"message":"success","data":{"id":123}}',
      executionTime: 85,
      operationTime: '2025-03-15T11:15:20.000+08:00',
      module: '项目管理',
      status: 'SUCCESS',
    },
    {
      id: 3,
      username: 'admin',
      operation: '删除用户',
      method: 'DELETE',
      url: '/users/456',
      ip: '192.168.1.100',
      userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
      requestParams: '{}',
      responseResult: '{"code":0,"message":"success","data":null}',
      executionTime: 60,
      operationTime: '2025-03-15T12:45:10.000+08:00',
      module: '用户管理',
      status: 'SUCCESS',
    },
    {
      id: 4,
      username: 'user2',
      operation: '登录失败',
      method: 'POST',
      url: '/auth/login',
      ip: '192.168.1.102',
      userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
      requestParams: '{"username":"user2","password":"wrong"}',
      responseResult: '{"code":401,"message":"用户名或密码错误","data":null}',
      executionTime: 45,
      operationTime: '2025-03-15T13:20:30.000+08:00',
      module: '认证模块',
      status: 'FAILED',
    },
    {
      id: 5,
      username: 'pm1',
      operation: '上传原型文件',
      method: 'POST',
      url: '/api/upload/原型文件',
      ip: '192.168.1.103',
      userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
      requestParams: '{"businessType":"原型文件","fileSize":2048000}',
      responseResult: '{"code":0,"message":"success","data":{"fileKey":"xxx"}}',
      executionTime: 2200,
      operationTime: '2025-03-15T14:30:45.000+08:00',
      module: '文件管理',
      status: 'SUCCESS',
    },
  ],

  // 安全事件列表
  securityEvents: [
    {
      id: 1,
      eventType: '登录失败次数过多',
      severity: 'HIGH',
      sourceIp: '192.168.1.102',
      targetUserId: 2,
      description: '用户user2登录失败次数超过阈值',
      details: '{"failedAttempts": 6, "threshold": 5}',
      handled: false,
      handledBy: null,
      handledTime: null,
      createdAt: '2025-03-15T13:21:00.000+08:00',
    },
    {
      id: 2,
      eventType: '异常登录',
      severity: 'MEDIUM',
      sourceIp: '203.0.113.45',
      targetUserId: 1,
      description: '用户admin在异常时间登录',
      details: '{"loginTime": "2025-03-15T02:30:00.000+08:00", "location": "上海", "previousLogin": "2025-03-14T18:00:00.000+08:00"}',
      handled: true,
      handledBy: 1,
      handledTime: '2025-03-15T09:15:00.000+08:00',
      createdAt: '2025-03-15T02:31:00.000+08:00',
    },
    {
      id: 3,
      eventType: '权限变更',
      severity: 'LOW',
      sourceIp: '192.168.1.100',
      targetUserId: 3,
      description: '用户角色权限发生变更',
      details: '{"oldRole": "USER", "newRole": "ADMIN", "changedBy": "admin"}',
      handled: true,
      handledBy: 1,
      handledTime: '2025-03-15T10:00:00.000+08:00',
      createdAt: '2025-03-15T10:00:00.000+08:00',
    },
  ],

  // 告警规则列表
  alertRules: [
    {
      id: 1,
      name: '登录失败告警',
      description: '当用户登录失败次数超过5次时触发告警',
      condition: '登录失败次数 > 5',
      severity: 'HIGH',
      enabled: true,
      notifyChannels: ['EMAIL', 'DINGTALK'],
      createdBy: 1,
      updatedBy: 1,
      createdAt: '2025-01-01T10:00:00.000+08:00',
      updatedAt: '2025-01-01T10:00:00.000+08:00',
    },
    {
      id: 2,
      name: '异常登录时间告警',
      description: '当用户在非工作时间登录时触发告警',
      condition: '登录时间 < 9:00 or 登录时间 > 18:00',
      severity: 'MEDIUM',
      enabled: true,
      notifyChannels: ['EMAIL'],
      createdBy: 1,
      updatedBy: 1,
      createdAt: '2025-01-02T10:00:00.000+08:00',
      updatedAt: '2025-01-02T10:00:00.000+08:00',
    },
    {
      id: 3,
      name: '权限变更告警',
      description: '当用户权限发生变更时触发告警',
      condition: '操作类型 == 权限变更',
      severity: 'LOW',
      enabled: true,
      notifyChannels: ['EMAIL', 'WECHAT_WORK'],
      createdBy: 2,
      updatedBy: 2,
      createdAt: '2025-01-03T10:00:00.000+08:00',
      updatedAt: '2025-01-03T10:00:00.000+08:00',
    },
  ],

  // 操作类型选项
  operationOptions: [
    { name: '登录系统', value: '登录系统' },
    { name: '登出系统', value: '登出系统' },
    { name: '创建项目', value: '创建项目' },
    { name: '编辑项目', value: '编辑项目' },
    { name: '删除项目', value: '删除项目' },
    { name: '上传文件', value: '上传文件' },
    { name: '下载文件', value: '下载文件' },
    { name: '创建用户', value: '创建用户' },
    { name: '编辑用户', value: '编辑用户' },
    { name: '删除用户', value: '删除用户' },
    { name: '权限变更', value: '权限变更' },
  ],

  // 模块选项
  moduleOptions: [
    { name: '认证模块', value: '认证模块' },
    { name: '用户管理', value: '用户管理' },
    { name: '项目管理', value: '项目管理' },
    { name: '文件管理', value: '文件管理' },
    { name: '权限管理', value: '权限管理' },
    { name: '系统配置', value: '系统配置' },
  ],

  // 严重程度选项
  severityOptions: [
    { name: '低', value: 'LOW' },
    { name: '中', value: 'MEDIUM' },
    { name: '高', value: 'HIGH' },
    { name: '紧急', value: 'CRITICAL' },
  ],
}
